package com.jugheadzhou.cilent1.controller;

import com.jugheadzhou.cilent1.service.LockService1;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author jugheadzhou
 * @date 2022-04-10
 */
@RestController
@RequestMapping("zoo")
public class LockController1 {

    @Resource
    private LockService1 lockService1;

    @GetMapping("/lock1")
    public String lock1(String lockKey){
        lockService1.lockTest(lockKey);
        return "测试Zookeeper lock1";
    }

    @GetMapping("/lock2")
    public String lock2(String lockKey){
        lockService1.lockTest(lockKey);
        return "测试Zookeeper lock2";
    }
}
